package com.zzzzzz.config;

import javax.inject.Inject;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

import com.mongodb.Mongo;
import com.zzzzzz.core.data.filestore.FileStorage;
import com.zzzzzz.core.data.filestore.MongodbFileStorage;

@Configuration
public class FileStoreConfig {
	
	@Inject
	private Mongo mongo;
	
	@Inject
	private Environment environment;
	
	@Bean
	public FileStorage fileStorage() {
		return new MongodbFileStorage(mongo, environment.getProperty("mongo.file_dbname"));
	}
	
}
